//
//  WDHTTPRequesTool.h
//  winterTest
//
//  Created by wwinter on 15/12/21.
//  Copyright © 2015年 winter. All rights reserved.
//

#import <AFNetworking/AFNetworking.h>

typedef NS_ENUM(NSInteger, NetState) {
    net_Connect_SUCCES					=0, //网络连接正常
    net_Connect_Failed					=1, //网络无数据
    net_Connect_TimeOut					=2, //网络连接超时
};

typedef NS_ENUM(NSInteger, MimeType) {
    mimeType_Image					=0, //图片
    mimeType_Audio					=1, //音频
    mimeType_Text                   =2, //文字
};

@interface WDHTTPRequesTool : AFHTTPRequestOperationManager

+ (instancetype)shareWDHTTPRequesTool;

/**
 *  get请求服务器数据
 *
 *  @param url        url 地址 NSSting
 *  @param completion block结果
 */
- (void)sendRequestWithGETURL:(NSString *)url
                   completion:(void(^)(NetState netState, id callbackData))completion;

/**
 *  post请求服务器数据
 *
 *  @param url        url 地址 NSSting 
 *  @param url        bodyDic 请求参数
 *  @param completion block结果
 */
- (void)sendRequestWithPostURL:(NSString *)url
                          body:(NSDictionary *)bodyDic
                    completion:(void (^)(NetState netState, id callbackData))completion;

- (void)uploadDataWith:(NSData *)data
                   url:(NSString *)url
              fileName:(NSString *)fileName
              mimeType:(MimeType)mimeType
                params:(NSDictionary *)params
              progress:(void (^)(CGFloat progressValue))progress
            completion:(void (^)(NetState netState, id callbackData))completion;
@end
